package cn.edu.hzw.comic.mvp.model

import android.app.DownloadManager
import android.view.View
import com.google.android.material.snackbar.Snackbar
import com.squareup.okhttp.Request
import java.time.Duration

fun getJsonString(url:String):String{
    val okClient = OkClient.instance()
    val request = Request.Builder().url(url).build()
    val response = okClient.newCall(request).execute()
    return response.body().string()
}
fun View.snackbar(messageRes:Int,duration:Int=Snackbar.LENGTH_SHORT){
    Snackbar.make(this,messageRes,duration).show()
}